## Table A4: Effects of Neighborhood Race and Income on Expected Wait Times: Deciles

## install.packages(c("tidyverse", "fixest"))
## library(tidyverse)

## SET WORKING DIRECTORY HERE
## setwd()

## Loading data
## load("dta.RData")

## Column 1
race_expected_wait_across_decile <- feols(log_expected_time ~ factor(white_decile) |
                                                    city^open_month^open_year, data = dta %>% filter(city != "New York"), cluster = "geo")

## Column 2
race_expected_wait_within_decile <- feols(log_expected_time ~ factor(white_decile) |
                                                    city_service^open_month^open_year, data = dta %>% filter(city != "New York"), cluster = "geo")

## Column 3
inc_expected_wait_across_decile <- feols(log_expected_time ~ factor(inc_decile) |
                                                   city^open_month^open_year, data = dta %>% filter(city != "New York"), cluster = "geo")

## Column 4
inc_expected_wait_within_decile <- feols(log_expected_time ~ factor(inc_decile) |
                                                   city_service^open_month^open_year, data = dta %>% filter(city != "New York"), cluster = "geo")

TableA4 = etable(race_expected_wait_across_decile, race_expected_wait_within_decile,
                 inc_expected_wait_across_decile, inc_expected_wait_within_decile,
                 signifCode = c("+" = 0.10, "*" = 0.05, "**" = 0.01, "***" = 0.001),
                 digits = 3, digits.stats = 3, fitstat =c("n","r2"))
